package ${package}.${rootArtifactId}.common.config;

import ${package}.${rootArtifactId}.common.interceptor.ReactInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.HashSet;
import java.util.Set;

/**
 * @author weidong.lin
 * @date 2021/7/8 11:06
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    /**
     * 添加拦截器
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //需要添加多个拦截器的话，调用addInterceptor()多次即可
        registry.addInterceptor(new ReactInterceptor())
                //拦截器要拦截的url规则
                .addPathPatterns("/wapi/callbackRecord/push")
                //拦截器屏蔽的url规则
                //.excludePathPatterns("/usr")
                //拦截器的执行顺序
                .order(1);

    }

}
